<html>
<head><meta charset="utf-8"><title>new lint is an error? · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html">new lint is an error?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="226016522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226016522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226016522">(Feb 11 2021 at 16:17)</a>:</h4>
<p>I'm adding a new lint to the <code>nursery</code> category based on <a href="https://github.com/rust-lang/rust-clippy/blob/master/doc/adding_lints.md">https://github.com/rust-lang/rust-clippy/blob/master/doc/adding_lints.md</a> but the lint is an error even though the UI test has <code>#![warn(clippy::my_lint)]</code>. I'm using <code>span_lint_and_sugg</code>.</p>



<a name="226016745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226016745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226016745">(Feb 11 2021 at 16:18)</a>:</h4>
<blockquote>
<p>note: <code>-D clippy::from-param-bounds</code> implied by <code>-D warnings</code></p>
</blockquote>



<a name="226016756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226016756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226016756">(Feb 11 2021 at 16:18)</a>:</h4>
<p>wait, why are there dashes in the name instead of underscores?</p>



<a name="226017091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226017091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226017091">(Feb 11 2021 at 16:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239001">leo60228</span> <a href="#narrow/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F/near/226016756">said</a>:</p>
<blockquote>
<p>wait, why are there dashes in the name instead of underscores?</p>
</blockquote>
<p>The console uses dashes in the lint names. Those are equivalent to the underscore names that are used almost everywhere else</p>



<a name="226017111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226017111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226017111">(Feb 11 2021 at 16:21)</a>:</h4>
<p>oh</p>



<a name="226017280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226017280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226017280">(Feb 11 2021 at 16:22)</a>:</h4>
<p><span class="user-mention" data-user-id="369415">@xFrednet</span> do i maybe need to explicitly observe the <code>#![warn]</code> in the test?</p>



<a name="226017758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226017758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226017758">(Feb 11 2021 at 16:27)</a>:</h4>
<p>I'm not sure if I understand you correctly <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> We usually define the tested lint as <code>#![warn(clippy::awesome_lint_name)]</code> to make sure that it will warn even if the category is allowed by default. This often also makes it easy to see in the file which lint is tested. Our ui test seems to deny all warnings. But this is totally fine and shouldn't affect you except that you get the note on the first lint message.</p>
<p>Does that answer your question <span class="user-mention" data-user-id="239001">@leo60228</span>  or have I misunderstood you?</p>



<a name="226017789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226017789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226017789">(Feb 11 2021 at 16:27)</a>:</h4>
<p>ohhhhhhhh<br>
that makes sense yeah<br>
thanks</p>



<a name="226017813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226017813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226017813">(Feb 11 2021 at 16:27)</a>:</h4>
<p>Which issue are you working on? <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="226017825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226017825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226017825">(Feb 11 2021 at 16:27)</a>:</h4>
<p>No problem, you're welcome</p>



<a name="226017853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226017853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226017853">(Feb 11 2021 at 16:27)</a>:</h4>
<p>You can link it via clippy#&lt;issue-id&gt;</p>



<a name="226017933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226017933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226017933">(Feb 11 2021 at 16:28)</a>:</h4>
<p>should i have made an issue before creating the lint? i didn't see anything about that in the contributing docs</p>



<a name="226018053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226018053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226018053">(Feb 11 2021 at 16:29)</a>:</h4>
<p>the warning is to use <code>T: Into&lt;i32&gt;</code> instead of <code>i32: From&lt;T&gt;</code>, see <a href="https://github.com/rust-lang/rust/issues/81971#issuecomment-777523657">https://github.com/rust-lang/rust/issues/81971#issuecomment-777523657</a></p>



<a name="226018093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226018093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226018093">(Feb 11 2021 at 16:29)</a>:</h4>
<p>Ahh new comers usually pickup an first-good-issue to get started. It's often better to create and issue also to maybe get some early feedback about categorization and difficulty.</p>



<a name="226018211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226018211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226018211">(Feb 11 2021 at 16:30)</a>:</h4>
<p>You can claim it for yourself if you want to implement it. That isn't in the docs though as far as I know. <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="226018363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226018363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226018363">(Feb 11 2021 at 16:31)</a>:</h4>
<p>Ahh, I've seen that example on reddit^^</p>



<a name="226018458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226018458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226018458">(Feb 11 2021 at 16:32)</a>:</h4>
<p><span class="user-mention" data-user-id="239001">@leo60228</span> before you put too much work into this: I think this lint already is implemented in Clippy: <a href="https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into">https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into</a></p>
<p><a href="https://github.com/rust-lang/rust-clippy/issues/6476">clippy#6476</a></p>
<p>And yeah, our UI tests deny all warnings.. This is required for the test framework to work.</p>



<a name="226018520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226018520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226018520">(Feb 11 2021 at 16:33)</a>:</h4>
<p><span class="user-mention" data-user-id="264664">@flip1995</span> that's for impls, not bounds</p>



<a name="226018780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226018780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226018780">(Feb 11 2021 at 16:34)</a>:</h4>
<p>Oh yeah, you're right. But I'm 99% sure that I saw some PR implementing recommending Into over From bindings <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="226018983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226018983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226018983">(Feb 11 2021 at 16:36)</a>:</h4>
<p>Yeah, this one: <a href="https://github.com/rust-lang/rust-clippy/issues/6620">clippy#6620</a></p>



<a name="226019047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226019047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226019047">(Feb 11 2021 at 16:36)</a>:</h4>
<p>oh</p>



<a name="226019068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226019068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> leo60228 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226019068">(Feb 11 2021 at 16:36)</a>:</h4>
<p>good thing i didn't get too far in implementing this, then</p>



<a name="226019295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226019295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226019295">(Feb 11 2021 at 16:38)</a>:</h4>
<p>If you want to play around with Clippy a bit, feel free to take a look at our <a href="https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-issue">good-first-issue</a>s :)</p>



<a name="226019489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/new%20lint%20is%20an%20error%3F/near/226019489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> xFrednet <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/new.20lint.20is.20an.20error.3F.html#226019489">(Feb 11 2021 at 16:39)</a>:</h4>
<p>You can claim one of them by commenting <code>@rustbot claim</code> in it. That will assign the issue to you</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>